<script setup>
import FormComponentMixin from "../FormComponentMixin.js";
import {computed } from "vue";
const props = defineProps({
  ...FormComponentMixin.props
})

console.log(JSON.stringify(props.config.props.columns));
const emit = defineEmits([...FormComponentMixin.emits])
const columns= computed(()=>{
  console.log(props.config.props.columns);
   return props.config.props.columns.filter(c => c.type === 'NumberInput')   
  });
</script>

<template>
  <el-form-item label="字段KEY">
    <el-input v-model="config.key" placeholder="请输入字段唯一key值"/>
  </el-form-item>
  <el-form-item label="字段名称">
    <el-input v-model="config.name" placeholder="请设置字段名称"/>
  </el-form-item>
  <el-form-item label="隐藏名称">
    <el-switch v-model="config.props.hideLabel"/>
  </el-form-item>
  <el-form-item label="是否必填">
    <el-switch v-model="config.props.required"/>
  </el-form-item>
  <el-form-item label="展示合计">
      <el-switch v-model="config.props.showSummary"></el-switch>
      <span v-if="config.props.showSummary" >注意：第一列不能合计，故第一列不要为数字输入框，否则不能合计</span>
      <!-- <el-select v-if="config.props.showSummary" style="width: 100%;" size="small" v-model="config.props.summaryColumns" multiple clearable placeholder="请选择合计项">
        <el-option :label="column.name" :value="column.id" v-for="column in columns" :key="column.id"/>
      </el-select> -->
    </el-form-item>
  <el-form-item label="显示边框">
    <el-switch v-model="config.props.showBorder" />
  </el-form-item>
</template>

<style lang="less" scoped>

</style>
